package com.example.haojiutao.service;



import com.example.haojiutao.common.Result;
import com.example.haojiutao.model.domain.User;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description: 用户业务逻辑接口层
 * @Author: cheng_jianzhen
 * @CreateTime: 2024/1/20 18:25
 */
@Transactional
public interface UserService {
    /*
     * @Description: TODO
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/20 18:34
     * @param: user
     * @return: int
     **/
    Result register(User user);

    /*
     * @Description: TODO 通过ID查询用户
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/20 18:36
     * @param: userId
     * @return: com.example.musicserver.model.domain.User
     **/
    User selectById(long userId);


    /*
     * @Description: TODO用户修改个人信息
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/20 18:42
     * @param: user
     * @return: com.example.musicserver.common.Result
     **/
    int updateUser(User user);
    /*
     * @Description: 删除用户
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/20 18:51
     * @param: id
     * @return: com.example.secondhand.common.Result
     **/
    int deleteById(Integer id);

    /*
     * @Description: 列表查询
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/20 19:01
     * @param: user
     * @return: com.example.secondhand.common.Result
     **/
    List<User> listByUser(User user);

    /*
     * @Description: //为普通用户提供控制器，用户个人信息查案，注册登录
     * @Author: cheng_jianzhen
     * @CreateTime: 2024/1/20 19:12
     * @return: com.example.musicserver.common.Result
     **/
    User getUserInfoById(int userId);

    User login(String phone, String password);

    List<User> getRecommendUseravg(User user);

    Result insertuser(User user);

    User getById(Integer id);

    User getUserInfoByName(String userName);
}
